package shoot;

import java.awt.image.BufferedImage;


/**
 * 小敌机
 */
public class SmallAirPlane extends FlyingObject implements Enemy {
    private int speed;
    public SmallAirPlane(){
        super(49,26);
        speed=2;
    }
    
    public static BufferedImage[] images=new BufferedImage[4] ;
    static {
    	for (int i = 0; i < images.length; i++) {
			images[i]=loadImage("smallairplane"+i+".png");
		}
    }
    
    
    int index=0;
    @Override
	public BufferedImage getImage() {
		// TODO Auto-generated method stub
		if (isLife()) {
			return images[0];
		} else if (isRemove()) {
			if (index==images.length) {
				state=DIE;
			}
			return images[index++];
		} 
		return null;
	}
    
    @Override
    public void step() {
    	// TODO Auto-generated method stub
    	this.y+=speed;
    }
    
    @Override
    public int getScore() {
    	// TODO Auto-generated method stub
    	return 2;
    }
    
}
